From 0ace362c8a8854b2256631d4edebb61d4238ddc3 Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Mon, 17 Sep 2018 15:49:14 +0100 Subject: [PATCH] xen: Disallow variable length arrays Variable length arrays result in excess stack utilisation, with a risk of stack overflow if the length is too large. It also results in fairly poor asm generation, because of requiring a divide as part of the space calcuation. Xen no longer has any variable length arrays, so take the opportunity to formally disallow them. Signed-off-by: Andrew Cooper Acked-by: Wei Liu Acked-by: Julien Grall Acked-by: Jan Beulich --- xen/Rules.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/Rules.mk b/xen/Rules.mk index ac0a8ea2e9..9c697dc57b 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -55,6 +55,7 @@ endif CFLAGS += -nostdinc -fno-builtin -fno-common CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith +$(call cc-option-add,CFLAGS,CC,-Wvla) CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h CFLAGS-$(CONFIG_DEBUG_INFO) += -g CFLAGS += '-D__OBJECT_FILE__="$@"' -- 2.30.2